﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Win32;
using Path = System.IO.Path;

namespace MediaPreviewCreator
{
    public class Class1
    {
        public List<MediaElement> creationMediaElement(Uri path) {
            List<MediaElement> medias = new List<MediaElement>();

            medias.Add( initMedia( path, 80, 80, -160, 0, 0, 0, 0 ) );
            medias.Add( initMedia( path, 80, 80, 0, -160, 0, -250, 180 ) );
            medias.Add( initMedia( path, 80, 80, -30, -300, 0, 0, 90 ) );
            medias.Add( initMedia( path, 80, 80, 25, 0, -130, -100, 270 ) );

            return medias;
        }

        public MediaElement initMedia(Uri path, int width, int height, int marginTop, int marginRight, int marginLeft, int marginBottom, int rotate) {
            MediaElement media = new MediaElement();

            media.Source = path;
            media.Width = width;
            media.Height = height;

            Thickness margin = media.Margin;
            margin.Top = marginTop;
            margin.Left = marginLeft;
            margin.Right = marginRight;
            margin.Bottom = marginBottom;
            media.Margin = margin;

            RotateTransform rotateTransform = new RotateTransform( rotate );
            media.RenderTransform = rotateTransform;

            media.ScrubbingEnabled = true;

            return media;
        }

    }
}
